package dancrawler.proto.cmd;

import java.util.HashMap;

/**
 *
 */
public class CmdRegister {
    private HashMap<Short, NetCommand> cmds = new HashMap<>();
    private CmdHandlerRegister hreg;
    
    public CmdRegister()
    {
        //updatePos - client
        cmds.put((short)1, new Command(1, new int[]{2,2,2}));
        //moveWest -server
        cmds.put((short)2, new Command(2, null));
        //moveNorth -server
        cmds.put((short)3, new Command(3, null));
        //moveEast -server
        cmds.put((short)4, new Command(4, null));
        //moveSouth -server
        cmds.put((short)5, new Command(5, null));
        //NewObj -client
        cmds.put((short)6, new Command(6, new int[]{2, 2, -1, 2}));
        //setFocus -client
        cmds.put((short)7, new Command(7, new int[]{2}));
        //setTile -client
        cmds.put((short)8, new Command(8, new int[]{2,2,2}));
        //showWorld -server
        cmds.put((short)9, new Command(9, null));
        //removeObject -client
        cmds.put((short)10, new Command(10, new int[]{2}));
        //ping -server
        cmds.put((short)11, new Command(11, null));
        //pong -client
        cmds.put((short)12, new Command(12, null));
        //cmdHello -server
        cmds.put((short)13, new Command(13,new int[]{-1}));
        //cmdDefPlayer -client
        cmds.put((short)14, new Command(14, new int[]{-1,2}));
        cmds.put((short)15, new Command(15, new int[]{2}));
        //cmdChatMsg -server
        cmds.put((short)16, new Command(16, new int[]{-1}));
        //cmdChatRec -client
        cmds.put((short)17, new Command(17, new int[]{2,-1}));
        //cmdAttack -server
        cmds.put((short)18, new Command(18, new int[]{1}));
        //cmdDie -client
        cmds.put((short)19, new Command(19, null));
        //cmdDefTile -client
        cmds.put((short)21, new Command(21, new int[]{2, -1}));
        //cmdSetViewRange -client
        cmds.put((short)22, new Command(22, new int[]{1}));
        //cmdActivatePortal -server
        cmds.put((short)23, new Command(23, null));
        //cmdClearMap -client
        cmds.put((short)24, new Command(24, null));
    }
    
    public NetCommand getCmd(short id)
    {
        return cmds.get(id);
    }
}
